/*
================================================================================
|                      🌐 Base Styles & Resets                      |
================================================================================
*/

/* --- Box Sizing & Reset --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- HTML & Body Defaults --- */
html {
    font-size: 16px; /* Base font size */
}

body {
    line-height: var(--line-height-base);
    background-color: var(--color-background-page);
    color: var(--color-text-primary);
    font-family: var(--font-family-base), serif;
    transition: background-color 0.3s var(--transition-easing), color 0.3s var(--transition-easing);
}

/* --- ✅ MODIFICATION START: Global styles for resizing state --- */
body.is-resizing {
    cursor: ew-resize !important;
    user-select: none !important;
}
body.is-resizing * {
    /* Prevent iframes or other elements from capturing mouse events during drag */
    pointer-events: none;
}
/* --- ✅ MODIFICATION END --- */

/* --- Scrollbar Styling (Telegram Style) --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-pill);
}
.colorscheme-dark ::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}
.colorscheme-dark ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* --- Common Elements --- */
a {
    color: var(--color-text-link);
    text-decoration: none;
    transition: color var(--transition-duration-fast) var(--transition-easing);
}

a:hover {
    text-decoration: underline;
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background-color: var(--color-background-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-2) var(--spacing-3);
    transition: border-color var(--transition-duration-fast) var(--transition-easing),
    box-shadow var(--transition-duration-fast) var(--transition-easing);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--color-border-interactive);
    box-shadow: var(--shadow-focus-ring);
}

/* --- Utility Classes --- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* [新增] 白板激活时的全局光标样式 */
body.whiteboard-active-cursor {
    cursor: crosshair;
}

@media (max-width: 768px) {
    /*
      Disable text selection globally on mobile to prevent accidental selection
      when scrolling or tapping.
    */
    body {
        -webkit-user-select: none; /* Safari, Chrome */
        -moz-user-select: none;    /* Firefox */
        -ms-user-select: none;     /* IE/Edge */
        user-select: none;         /* Standard */
    }

    /*
      Re-enable text selection for input fields so users can still
      copy/paste text inside them.
    */
    input,
    textarea {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
}